<template>
  <div>
    <h3>mapper配置</h3>
    <el-row :gutter="20">
      <el-col :span="5">
        包名：
        <el-input placeholder="mapper包名" class="mapper-package" value="mapper" v-model="mapperSetting.mapperPackage"/>
      </el-col>
      <el-col :span="5">
        类名后缀：
        <el-input placeholder="类名后缀" class="class-sufix" v-model="mapperSetting.mapperSufix"/>
      </el-col>
      <el-col :span="14">
        <el-col :span="8">
          <el-checkbox label="继承基础Mapper"
                       v-model="mapperSetting.extendBaseMapper"/>
        </el-col>
        <el-col :span="12">
          <el-checkbox label="@Mapper注解" v-model="mapperSetting.useMapperAnonntation"/>
        </el-col>
      </el-col>
    </el-row>


  </div>
</template>

<script>
  import {mapGetters} from "vuex";
  import {mapState} from "vuex";

  export default {
    name: "Project",
    computed: {
      ...mapGetters(["mapperSetting", "projectSetting"]),
      ...mapState(["serviceSetting"])
    }, watch: {
      mapperSetting: {
        deep: true, //深度监视
        handler: function (newValue, oldValue) {
          this.serviceSetting.useBaseService = newValue.extendBaseMapper;
        }
      }
    }
  }
</script>

<style scoped>
  @import "../../../static/css/content.css";

  .class-sufix {
    width: 45%;
  }

  .mapper-package {
    width: 52%;
  }
</style>
